package com.movie.demo.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.movie.demo.controller.RommController;
import com.movie.demo.mapper.RoomMapper;
import com.movie.demo.pojo.Room;
import com.movie.demo.pojo.Seat;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Objects;

@Service
@Transactional
public class RoomService extends ServiceImpl<RoomMapper, Room> implements com.movie.demo.service.RoomService {
    @Override
    public List<Room> selectRoom() {
        List<Room> roomList=this.selectList(new EntityWrapper<Room>());
        return roomList;
    }

    @Override
    public boolean updateRoom(Room room) {
        Room rooms = this.selectById(room.getId());
        if (Objects.isNull(rooms) || rooms == null)return false;
        rooms.setRow(room.getRow());
        rooms.setCol(room.getCol());
        boolean result=this.updateById(rooms);
        return result;
    }
}
